using System;
using System.Windows.Forms.DataVisualization.Charting;

namespace Nuwanda.TfsSpotlight.Views.ChartView
{
    /// <summary>A wrapper for chart control to prevent some unexpected exceptions.</summary>
    internal class SafeChart : Chart
    {
        /// <summary>Hides some exceptions that are thrown while there is no space for chart.</summary>
        protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
        {
            try
            {
                base.OnPaint(e);
            }
            catch(ArgumentException) {}
        }
    }
}